﻿/**********************************************************************
 * @file   GUILoadBaseDialog.h
 * @brief  载荷窗口基类声明
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2024-12-09
 *********************************************************************/
#ifndef _GUILoadBaseDialog_H
#define _GUILoadBaseDialog_H

#include "GUILoadDialogAPI.h"
#include "GUIWidget/GUIDialogBase.h"
#include "FITK_Kernel/FITKCore/FITKActionOperator.h"
#include "FITK_Component/FITKAcousticsPhysics/FITKAcousticsAbstractLoad.h"

namespace Core
{
    class FITKActionOperator;
}

class QComboBox;

namespace Acoustics
{
    class FITKAcousticsAbstractLoad;
}

namespace GUI
{
    /**
     * @brief 载荷窗口基类
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date 2024-10-23
     */
    class GUILoadDialogAPI GUILoadBaseDialog : public GUIDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief load object dialog
         * @param[i]  obj            My Param doc
         * @param[i]  oper           operator
         * @param[i]  parent
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        explicit GUILoadBaseDialog(Acoustics::FITKAcousticsAbstractLoad* obj, Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief Destroy object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        virtual ~GUILoadBaseDialog();
        /**
         * @brief    数据初始化
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-09
         */
        virtual void init() = 0;

    protected:
        /**
         * @brief    创建数据对象
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-06
         */
        bool createObjData();
        /**
         * @brief    编辑数据对象
         * @return   boiol
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-06
         */
        bool editObjData();
        /**
         * @brief    下拉框设置频谱数据
         * @param[i] comboBoxList 需要设置的下拉框数据
         * @param[i] typeList 需要设置的频谱类型
         * @param[i] isSetDefault 是否设置默认数据
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-09
         */
        void setComboBoxSpectra(QList<QComboBox*> comboBoxList, QList<int> typeList, bool isSetDefault = true);
        /**
         * @brief    获取拾取离散数据类型
         * @param[i] pickObjID 拾取对象ID
         * @param[o] isSEAModel true : SEAModel, false : FEModel
         * @param[o] seaType SEA模型类型
         * @return   bool 状态 ： true 成功 false 失败
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-10
         */
        bool getPickDiscDataType(int pickObjID, bool& isSEAModel, int& seaType);
        /**
         * @brief    从管理器中获取新名称
         * @return   QString
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-10-24
         */
        QString ckeckNameFromMgr(QString name);
        /**
         * @brief    从界面获取数据
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-09
         */
        virtual void getDataFormWidget() = 0;
        /**
         * @brief    从界面里获取设置的名称
         * @return   QString
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-10
         */
        virtual QString getNameFormWidget() = 0;
    protected:
        /**
         * @brief    显示事件
         * @param[i] event                 事件对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-12-16
         */
        void showEvent(QShowEvent* event);
        /**
         * @brief    取消高亮
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void disHight();
    protected slots:
        ;
        /**
         * @brief    确认事件重写
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void accept() override;
        /**
         * @brief    取消事件重写
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-07
         */
        void reject() override;
    protected:
        /**
         * @brief 载荷数据对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Acoustics::FITKAcousticsAbstractLoad* _obj = nullptr;
        /**
         * @brief 操作器对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-10-23
         */
        Core::FITKActionOperator* _oper = nullptr;
        /**
         * @brief  是否是创建
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-12-16
         */
        bool _isCreate = false;
    };
}

#endif
